<template>
		<view class="login-page">
			<view style="height: 20px;"></view> <!-- 添加一个空白视图作为间距 -->
			<view style="">
			<image src="/static/images/bg6.jpg"  style="object-fit: cover;width: 700rpx;height: 600rpx;margin-bottom: 100rpx;"></image>
			</view>	
			
			<uni-card padding="15px" margin="10px" spacing="0" style="text-align: center; font-weight: bold; ">
				<view style="margin-top: 30rpx;">
					<u-radio-group v-model="id">
						<view v-for="(item, index) in identityList" :key="index" style="margin-right: 100rpx;">
						<u-radio 
							@change="radioChange" 
							
							:name="item.name"
							:disabled="item.disabled"	
							
						>
						
							{{item.name}}
						</u-radio>
						</view>
					</u-radio-group>
					
					<u-form>
						<u-form-item label-position="top"  label="账号" label-width="150">
							<!-- <view style="color: #000000;font-size: medium;text-align: left;">+86 </view> -->
							<!-- <view style="color: #ccccce;font-size: 30rpx;padding-right: 20rpx;"></view> -->
							<u-input height="50"  placeholder="请输入账号"   v-model="mobile" type="text" :clearable="false"></u-input>
						</u-form-item>
						<u-form-item label-position="top" label="密码" label-width="150">
							<u-input placeholder="请输入密码" v-model="login_pwd" type="text" :clearable="false"></u-input>
						</u-form-item>
					</u-form>
				</view>
				<view class="button-container">
					  <u-button class="login-btn" shape="circle" type="primary" @click="login" style="font-weight: bold;">登录</u-button>
					  <view class="space"></view> <!-- 添加一个空白视图作为间距 -->
					  <u-button class="register-btn"  plain="true" color="#383838" shape="circle" @click="register" style="font-weight: bold;">注册</u-button>
				</view>
				
				
			</uni-card>

					
			</view>		
			
	
</template>

<script>
	
	export default {
		data() {
			return {
				list: [{name: '验证码登录'},],
				list1:[{
					cate_name: '验证码登录'
				}, {
					cate_name: '密码登录',
					}],
				current: 0,
				mobile:'',
				login_pwd:'',
				verificationCode: '',
				inviteCode: '',
				inviteCodeReadonly: false,
				codeTips: '',
				verificationCodeTipFlag: false,
				identityList: [
					{
						name: '企业用户',
						disabled: false
					},
					{
						name: '机关用户',
						disabled: false
					}
				],
				id:'企业用户'
			}
		},
		onLoad(option) {
			var inviteCode = option.inviteCode;
			if (inviteCode) {
				this.inviteCode = inviteCode;
				this.inviteCodeReadonly = true;
			}
		},
		methods: {
			radioChange(e) {
				this.id = e;
			},
			//切换登录账号
			change(index) {
				this.current = index;
			},
		
			codeChange(text) {
				this.codeTips = text;
			},

		

			login(){
				var that = this;
				if (that.mobile === null || that.mobile === "") {
					// console.log("123")
					uni.showToast({
						title: "请输入账号",
						icon: "none"
					});
					return;
				}
				if (that.login_pwd === null || that.login_pwd === "") {
					uni.showToast({
						title: "请输入密码",
						icon: "none"
					});
					return;
				}
				
				if(that.mobile === "root" && that.login_pwd === "123"){
					if(this.id == '机关用户')
						uni.reLaunch({
							url: "../index/new_index?id="+this.id
						});
					else{
						uni.reLaunch({
							url: "../index/company_info"
						});
					}
				}
				
				
			}

		}
	}
</script>

<style>

	
	.button-container {
	  display: flex;
	  justify-content: center; /* 将按钮居中对齐 */
	  padding-top: 64rpx;
	}
	
	.space {
	  width: 40px; /* 设置间距宽度 */
	}
	
	.verification-code-tip {
		padding-left: 16rpx;
		padding-right: 32rpx;
	}

	.login-btn {
		padding-top: 64rpx;
	}



	.login-page {

		
		background-color: #F4F4F4;
	    border-radius: 62rpx 62rpx 0rpx 0rpx;
		padding-top: 32rpx;
		
	}
	
	.login-tip {
		display: flex;
		color: #888;
		
	}
	
	.register{
		display: flex;
		color: #3c93ef;
	}
	
	.bottom{
		display: flex;
		padding-top: 64rpx;
		justify-content: center;
		font-size: small;
		
	}
</style>
